#pragma once


// CColorBox

struct ColorInfo
{
	CString name;
	COLORREF rgb;
};

class CColorBox : public CComboBox
{
	DECLARE_DYNAMIC(CColorBox)

public:
	CColorBox();
	virtual ~CColorBox();

	COLORREF GetColor();
	CString& GetColorName();

private:
	static CArray<ColorInfo> colors;
	static bool initialized;
	int selected;
	bool isAdded;

	void InitColors(); 
	void AddData();
	void InsertColor(int index, CString name, COLORREF rgb);

protected:
	DECLARE_MESSAGE_MAP()
public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/);
};


